import axios from 'axios';
import router from 'umi/router';
import {message} from 'antd';

function getQRImg() {
	return axios.get('http://stockcha.market.alicloudapi.com/stock',{src:'sz300043'})
}
export default {
	namespace: 'aliyun',
	state: {
		
	},
	effects: {
		* getData({}, {
			call,
			put
		}) {
			const {error,data} = yield call(getQRImg)
			if(!error){
				yield put({type:'initData',payload:{code:data.key,pic:data.pic}});
			}
		}
	},
	reducers: {
		initData(state,action){
			const {code,pic} = action.payload;
			return {...state,code,pic};
		}
	}
}